package com.zdxf.listener;

import com.zdxf.event.UserLoginEvent;
import lombok.extern.slf4j.Slf4j;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class UserLoginListener implements ApplicationListener<UserLoginEvent> {

    private Logger logger = LogManager.getLogger();

    @Override
    public void onApplicationEvent(UserLoginEvent event) {
        logger.info("<=" + event.getMessage() + "=>：{}", event.getUserName());
    }
}
